package com.ry;

import com.ry.util.timepick.R;
import com.ry.util.CommonConstants;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.RelativeLayout;

public class StartActivity extends Activity {
	private RelativeLayout rlytDailyRent;
	private RelativeLayout rlytPickUp;
	private RelativeLayout rlytHourRent;
	private RelativeLayout rlytCustomRoute;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.start);
		init();
	}

	private void init() {
		rlytDailyRent = (RelativeLayout) findViewById(R.start.rlyt_daily_rent);
		rlytPickUp = (RelativeLayout) findViewById(R.start.rlyt_pick_up);
		rlytHourRent = (RelativeLayout) findViewById(R.start.rlyt_hour_rent);
		rlytCustomRoute = (RelativeLayout) findViewById(R.start.rlyt_custom_route);

		rlytDailyRent.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(StartActivity.this, CityAndModelActivity.class);
				intent.putExtra("type", CommonConstants.DAILY_RENT);
				startActivity(intent);
			}
		});

		rlytPickUp.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(StartActivity.this, PickUpActivity.class);
				intent.putExtra("type", CommonConstants.PICK_UP);
				startActivity(intent);
			}
		});

		rlytHourRent.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(StartActivity.this, CityAndModelActivity.class);
				intent.putExtra("type", CommonConstants.HOUR_RENT);
				startActivity(intent);
			}
		});

		rlytCustomRoute.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(StartActivity.this, CityAndModelActivity.class);
				intent.putExtra("type", CommonConstants.CUSTOM_ROUTE);
				startActivity(intent);
			}
		});
	}
}
